package com.ticket.sass.common.entity.tenant;

import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 订单影片销售关联
 * </p>
 *
 * @author ywb
 * @since 2024-04-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@TableName("order_film_sale_maps")
@ApiModel(value="OrderFilmSaleMapsEntity对象", description="订单影片销售关联")
public class OrderFilmSaleMapEntity implements Serializable {
    @ApiModelProperty(value = "订单影片销售关联ID")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "影片ID")
    private Long filmId;

    @ApiModelProperty(value = "日期")
    private LocalDate date;

    @ApiModelProperty(value = "数量")
    private Integer count;

    @ApiModelProperty(value = "金额")
    private BigDecimal amount;

    @ApiModelProperty(value = "影院ID")
    private Long cinemaId;

    @ApiModelProperty(value = "租户ID")
    private Long tenantId;
    
    @ApiModelProperty(value = "创建时间")
    @TableField(fill = FieldFill.INSERT)
    public LocalDateTime createdAt;
    
    @ApiModelProperty(value = "更新时间")
    @TableField(fill = FieldFill.INSERT_UPDATE)
    public LocalDateTime updatedAt;
    
    @TableField(select = false)
    @ApiModelProperty(value = "删除时间")
    @TableLogic(value = "null", delval = "now()")
    public LocalDateTime deletedAt;
    
    public OrderFilmSaleMapEntity() {
    }
    
    public OrderFilmSaleMapEntity(Long filmId, LocalDate date, Integer count, BigDecimal amount, Long cinemaId, Long tenantId) {
        this.filmId = filmId;
        this.date = date;
        this.count = count;
        this.amount = amount;
        this.cinemaId = cinemaId;
        this.tenantId = tenantId;
    }
}
